package com.hxm.meizi.http;

import rx.Subscriber;

/**
 * Created by Hxm on 2017/2/22.
 * Base Subscriber
 */

public abstract class BaseSubscriber<T> extends Subscriber<T> {
    @Override
    public void onCompleted() {

    }

    @Override
    public void onError(Throwable e) {
        if (e instanceof NetException.ResponseThrowable) {
            onError((NetException.ResponseThrowable) e);
        } else {
            onError(new NetException.ResponseThrowable(e, NetException.ERROR.UNKNOWN));
        }
    }

    public abstract void onError(NetException.ResponseThrowable e);
}
